package com.junci.mtest.vm.handler;

import android.view.View;

import com.junci.mtest.utils.ToastUtil;
import com.junci.mtest.views.BaseActivity;
import com.junci.mtest.utils.NavigationUtil;

import java.io.Serializable;

/**
 * 所有页面监听handler父类
 * 包含通用方法
 * 退出activity [back]
 * 跳转首页 [goHome]
 * 分享 [share]
 * 收藏 [mark]
 *
 */
public class BaseClickHandler{
    private static final String TAG = "BaseClickHandler";

    /**
     * 退出当前activity
     * @param view
     *
     */
    public void back(View view){
        BaseActivity context = (BaseActivity) view.getContext();
        context.removeActivity();
    }
    public void goHome(View view){
        BaseActivity context = (BaseActivity) view.getContext();
        NavigationUtil.goToMain(context);
    }
    public void share(View view, Serializable bean){
        ToastUtil.show(view.getContext(),"点击分享");
    }
    public void mark(View view, Serializable bean){
        ToastUtil.show(view.getContext(),"Star");
    }


}